# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.WeightedFontFamily do
  @moduledoc """
  Represents a font family and weight of text.

  ## Attributes

  *   `fontFamily` (*type:* `String.t`, *default:* `nil`) - The font family of the text. The font family can be any font from the Font menu in Docs or from [Google Fonts] (https://fonts.google.com/). If the font name is unrecognized, the text is rendered in `Arial`.
  *   `weight` (*type:* `integer()`, *default:* `nil`) - The weight of the font. This field can have any value that's a multiple of `100` between `100` and `900`, inclusive. This range corresponds to the numerical values described in the CSS 2.1 Specification, [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness), with non-numerical values disallowed. The default value is `400` ("normal"). The font weight makes up just one component of the rendered font weight. A combination of the `weight` and the text style's resolved `bold` value determine the rendered weight, after accounting for inheritance: * If the text is bold and the weight is less than `400`, the rendered weight is 400. * If the text is bold and the weight is greater than or equal to `400` but is less than `700`, the rendered weight is `700`. * If the weight is greater than or equal to `700`, the rendered weight is equal to the weight. * If the text is not bold, the rendered weight is equal to the weight.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fontFamily => String.t() | nil,
          :weight => integer() | nil
        }

  field(:fontFamily)
  field(:weight)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.WeightedFontFamily do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.WeightedFontFamily.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.WeightedFontFamily do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
